<template>
  <div class="dynamic-container">
    <!-- 左侧用户信息卡片 -->
    <div class="detail-container">
      <div class="user-card">
        <!-- 用户名和等级 -->
        <div class="user-header">
          <span class="username">陌上倾城落蝶雨</span>
          <span class="user-level">LV.9</span>
        </div>

        <!-- 用户统计数据 -->
        <div class="user-stats">
          <div class="stat-item">
            <div class="stat-number">14</div>
            <div class="stat-label">关注</div>
          </div>
          <div class="stat-item">
            <div class="stat-number">0</div>
            <div class="stat-label">粉丝</div>
          </div>
          <div class="stat-item">
            <div class="stat-number">1</div>
            <div class="stat-label">动态</div>
          </div>
        </div>
      </div>
    </div>

    <div class="main-container">中</div>
    <div class="other-container">
      <div class="bg-card">
        <img src="@/assets/imgs/fan_video/loop_img2.png" alt="">
      </div>
      <!-- 轮播图 -->
      <div class="loop-img">
        <el-carousel>
          <el-carousel-item v-for="(item, index) in imgs" :key="index">
            <img :src="item.url" alt="">
          </el-carousel-item>
        </el-carousel>
      </div>
      <!-- 热搜榜 -->
      <div class="hot-search">
        <h3>bilibili热搜榜</h3>
        <div class="hot-item" v-for="(item, index) in items" :key="index">
          <span class="item-number">{{ index + 1 }}</span>
          <span class="item-text">{{ item.text }}</span>
          <span v-if="item.hot" class="hot-tag">🌬</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 引入图片
import img1 from '@/assets/imgs/fan_video/loop_img1.png'
import img2 from '@/assets/imgs/fan_video/loop_img3.png'
const imgs = [
  { url: img1 },
  { url: img2 },
];

const items = [
  { text: '速览NBA25届新秀实力' },
  { text: '小米AI眼镜超深度体验', hot: true },
  { text: '朝鲜是如何报道伊以冲突的', hot: true },
  { text: '吸血鬼重度依赖', hot: true },
  { text: '再战高考的数学老师出分了' },
  { text: '净网 网警公布打击谣言8起典型案例' },
  { text: '北约秘书长叫特朗普爸爸是真的吗' },
  { text: '为什么东北这么热' },
  { text: '徐静雨愿赌服输换头像' },
  { text: '交叉学科专业值得选吗', hot: true }
];
</script>

<style scoped lang="scss">
.dynamic-container {
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: 100vh;
  background-image: url('@/assets/bg_img.png');
  margin: 0 auto;

  .detail-container {
    flex: 2;

    .user-card {
      background-color: #fff;
      border-radius: 8px;
      padding: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

      .user-header {
        display: flex;
        align-items: center;
        margin-bottom: 16px;

        .username {
          font-size: 16px;
          font-weight: 600;
          color: #222;
          margin-right: 8px;
        }

        .user-level {
          font-size: 12px;
          color: #fff;
          background-color: #fb7299;
          padding: 2px 6px;
          border-radius: 4px;
          font-weight: bold;
        }
      }

      .user-stats {
        display: flex;
        justify-content: space-between;

        .stat-item {
          text-align: center;
          flex: 1;

          .stat-number {
            font-size: 18px;
            font-weight: bold;
            color: #222;
            margin-bottom: 4px;
          }

          .stat-label {
            font-size: 12px;
            color: #999;
          }
        }
      }
    }
  }

  .main-container {
    flex: 5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #888;
  }

  .other-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;

    .bg-card {
      width: 100%;
      height: 140px;

      background-position: center;
      border-radius: 10px;
    }

    .loop-img {

      .el-carousel {
        border-radius: 8px;


        .el-carousel__container {
          height: 200px;
          margin-top: 20px;
        }

        img {
          width: 100%;
          height: 200px;
        }
      }
    }

    .hot-search {
      background-color: #fff;
      border-radius: 8px;
      padding: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

      h3 {
        font-size: 16px;
        margin-bottom: 16px;
        color: #222;
        font-weight: 600;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f0f0;
      }

      .hot-item {
        display: flex;
        align-items: center;
        padding: 8px 0;
        font-size: 14px;

        .item-number {
          color: #fb7299;
          font-weight: bold;
          width: 24px;
          text-align: center;
          margin-right: 8px;
        }

        .item-text {
          flex: 1;
          color: #222;
        }

        .hot-tag {
          color: #ff9500;
          margin-left: 8px;
          font-size: 16px;
        }

        &:hover {
          background-color: #f4f4f4;
          cursor: pointer;
          border-radius: 4px;
        }
      }
    }
  }
}
</style>
